package com.woniuxy02;

/**
 * @author 作者
 * @create 2025-07-25 16:44
 */
public class Test05 {
    public static void main(String[] args) {
        String str = "abcdefgabc";
        System.out.println(str.charAt(0));
        System.out.println(str.charAt(1));
        System.out.println(str.charAt(2));
        System.out.println(str.indexOf('b'));
        System.out.println(str.indexOf(98));
        System.out.println(str.indexOf("bcd"));
        System.out.println(str.indexOf("abd"));
        System.out.println(str.indexOf("abc",0));
        System.out.println(str.indexOf("abc",1));
//      String str2 = "012345";
        String str2 = "abcdef";
        System.out.println(str2.substring(2));
        System.out.println(str2.substring(1));
        System.out.println(str2.substring(1,5));
        //重指定位置开始，一直截取到最后
        System.out.println(str2.substring(1,str2.length()));
        System.out.println(str2);
    }
}
